<extend name="Public:base" />
<block name="box-content">
<style type="text/css">
.check-box
{
    float: left;
    width:120px;
}    
.check-line .inline{
    top: 1px;
}
</style>
<div class="box box-color box-bordered">
    <div class="box-title">
        <h3>
            <i class="fa fa-table"></i>
            {$tableTitle}【{$role.name}】
        </h3>
    </div>
    <div class="box-content">
    <form action="#" method="POST" class='form-horizontal'>
        <volist name="aclist" id="ac">
        <div class="form-group">
            <label for="textfield" class="control-label col-sm-1">
                <empty name="ac['title']">
                    {$ac.name}
                <else/>
                    {$ac.title}
                </empty>
            </label>
            <div class="col-sm-11">
                <volist name="ac[actions]" id="a">
                <div class="check-box check-line">
                    <input data-group="{$a.group}" data-mod="{$a.mod}" data-ac="{$a.ac}" type="checkbox" id="{$a.mod}-{$a.ac}" class='icheck-me' data-skin="flat" data-color="red" {$a.check}>
                    <label class='inline' for="{$a.mod}-{$a.ac}">{$a.title}</label>
                </div>
                </volist>
            </div>
        </div>
        </volist>
    </form>    
    </div>
</div>
<script type="text/javascript">
$(function(){
  $('input[type=checkbox]').click(function(){
    var rid = "{$Think.get.id}";
    var group = $(this).data('group');
    var mod = $(this).data('mod');
    var ac = $(this).data('ac');
    if($(this).is(":checked"))
    {
      var url = "{:U('Admin/Role/addRoleNode')}";
      $.getJSON(url,{rid:rid,group:group,mod:mod,ac:ac},function(){

      })
    }else{
      var url = "{:U('Admin/Role/delRoleNode')}";
      $.getJSON(url,{rid:rid,group:group,mod:mod,ac:ac},function(){
        
      })
    }
  })
})
</script> 
<!-- icheck -->
<script src="__PUBLIC__/js/plugins/icheck/jquery.icheck.min.js"></script>
<!-- icheck -->
<link rel="stylesheet" href="__PUBLIC__/css/plugins/icheck/all.css">
</block>